yinyang(r,cc,ca,serp,c1,c2):=PROG(
         "@ the circle",
         cc:=x^2+y^2=r^2,
         "@ the filled circle",
         ca:=x^2+y^2<=r^2,
         "@ both small circles",
         c1:=(x-r/2)^2+y^2<=(r/8)^2,~
         c2:=(x+r/2)^2+y^2<=(r/8)^2,~
         "@ the serpent line",
         serp:=IF(x<-r,?,
                  IF(x<0,
                     -SQRT(r^2/4-(x+r/2)^2),
                     IF(x<r,
                        SQRT(r^2/4-(x-r/2)^2),
                        ?)
                    )
                  ),
         "@ Boolean composition of inequalities",
         [cc,(ca AND y<=serp AND NOT(c1)) OR c2]
       )
